package core;

import java.util.ArrayList;

import com.shilehui.www.R;

import core.data.HelpDataInfomation;

import android.content.Context;

public class ServerHelper {

//////////////////////////////////////////////////////////////
// test code
	private Context context = null;
	
	public Context getContext() {
		return context;
	}

	public void setContext(Context context) {
		this.context = context;
	}
///////////////////////////////////////////////////////////
	

	// shared server helper
	static private ServerHelper instance = null;
	
	static public ServerHelper sharedServerHelper(){
		if( instance == null )
			instance = new ServerHelper();
		return instance;
	}
	
	public ServerHelper(){
		instance = this;
	}
	
	public ArrayList<HelpDataInfomation> getHotsposts(){
		
		ArrayList<HelpDataInfomation> buffer = new ArrayList<HelpDataInfomation>();
		
		HelpDataInfomation info = new HelpDataInfomation();
		info.setTitle("test1");
		info.setImage(getContext().getResources().getDrawable(R.drawable.test1));
		info.setId(1);
		buffer.add(info);
		
		info = new HelpDataInfomation();
		info.setTitle("test2");
		info.setImage(getContext().getResources().getDrawable(R.drawable.test2));
		info.setId(2);
		buffer.add(info);
		
		return buffer;
		
	}
	
	public ArrayList<HelpDataInfomation> getHelpList(){
		ArrayList<HelpDataInfomation> buffer = new ArrayList<HelpDataInfomation>();
		
		HelpDataInfomation info = new HelpDataInfomation();
		info.setTitle("test1");
		info.setImage(getContext().getResources().getDrawable(R.drawable.test1));
		info.setId(1);
		buffer.add(info);
		
		info = new HelpDataInfomation();
		info.setTitle("test2");
		info.setImage(getContext().getResources().getDrawable(R.drawable.test2));
		info.setId(2);
		buffer.add(info);
		
		return buffer;
	}
	
}
